package cn.tedu.account.tx;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

import java.math.BigDecimal;

/**
 * @author Amos
 * @date 2022/4/27
 */

@LocalTCC
public interface AccountTccAction {
    @TwoPhaseBusinessAction(name = "AccountTccAction")
    boolean prepare(BusinessActionContext cxt,
                    @BusinessActionContextParameter(paramName = "userId")
                    Long userId,
                    @BusinessActionContextParameter(paramName = "money")
                    BigDecimal money);
    boolean commit(BusinessActionContext cxt);
    boolean rollback(BusinessActionContext cxt);
}
